package org.yanfengying.org.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import org.yanfengying.utils.domain.BastDomain;

import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department extends BastDomain {

    @ApiParam(value = "部门名",required = true)
    private String name;
    @ApiParam(value = "部门简介" )
    private String intro;
    @ApiParam(value = "创建时间")
    private Date create_time;
    @ApiParam(value = "修改时间")
    private Date update_time;
    @ApiParam(value = "父部门")
    private Department parent;
    @ApiParam(value = "管理人员")
    private Employee employee;

    private List<Department> children;
    @ApiParam(value = "管理人员")
    private String path;
    @ApiParam(value = "管理人员")
    private Integer state;

    @JsonFormat(pattern = "yyyy-MM-DD hh:mm:ss",timezone = "GMT+8")
    public Date getCreate_time() {
        return create_time;
    }

    @DateTimeFormat(pattern = "yyyy-MM-DD hh:mm:ss")
    public void setCreate_time(Date create_time) {
        this.create_time = create_time;
    }

    @JsonFormat(pattern = "yyyy-MM-DD hh:mm:ss",timezone = "GMT+8")
    public Date getUpdate_time() {
        return update_time;
    }

    @DateTimeFormat(pattern = "yyyy-MM-DD hh:mm:ss")
    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }
}

